import form from '@/utils/mixins/form'

export default {
  mixins: [form],

  data () {
    return {
      fieldsAsync: null,

      formFields: [
        {
          label: 'value',
          value: '',
          link: '人工审核',
          callback: (data) => data.toString(),
          field: {},
        },
        {
          label: 'value',
          value: '',
          link: '处理结果',
          callback: (data) => data.toString(),
          field: {},
        },
      ],
    }
  },

  computed: {
    fieldIndex () {
      const findIndex = this.formFields
        .findIndex(({ field }) => {
          const { can_do, setting: { read_only } } = field
          return can_do && !read_only
        })

      return findIndex
    },
  },

  created () {
    this.fieldsAsync = this.getTemplateFields()
  },
}
